#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <stdlib.h>
#include <linux/types.h>
#include <linux/videodev2.h>
#include <malloc.h>
#include <math.h>
#include <sys/mman.h>
#include <errno.h>
#include <assert.h>
#include <string.h>
#include <sys/time.h>
#include <linux/fb.h>
#include <time.h>
#include <iostream>
#include <fstream>
#include <string>

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdint.h>
#include <string.h>
#include <sys/stat.h>
#include <errno.h>
#include <linux/input.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <sys/statfs.h>
#include <linux/fb.h>
#include <wchar.h>
#include <linux/videodev.h>
#include <signal.h>
#include "fb_ioctl.h"

using namespace std;

#include <asm/ioctl.h>


class fb_device
{
private:
	struct fb_var_screeninfo sVar;
	string device_name;
	int s_i32FBWidth;
	int s_i32FBHeight;

public:
	int32_t i32FBFd; 
	
public:
	fb_device();
	fb_device(string device_name);
	
	int InitFBDevice(uint8_t **ppu8FBBuf,uint32_t *pu32FBBufSize);
	void OSDInit(int i32FBFd,int i32Width,int i32Height,uint8_t *pu8OSDBuff);
	int OSDCheckExist(int i32FBFd);
	void ClearFB(int32_t i32FBFd,uint8_t *pu8FBBufAddr);
	int fb_get_width();
	int fb_get_height();

	
			
};
